package com.codedancer.campus.po;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@TableName(value = "update_log", autoResultMap = true)
@Table(name = "update_log", comment = "更新日志")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UpdateLog {

    @TableId
    @TableField("uuid")
    @Column(name = "uuid", type = MySqlTypeConstant.VARCHAR, length = 36, isKey = true, isNull = false, comment = "uuid")
    private String uuid;

    @TableField("content")
    @Column(name = "content", type = MySqlTypeConstant.TEXT, isNull = false, comment = "更新内容")
    private String content;

    @TableField("version")
    @Column(name = "version", type = MySqlTypeConstant.VARCHAR, length = 64, isNull = false, comment = "更新版本")
    private String version;

    @TableField("is_top")
    @Column(name = "is_top", type = MySqlTypeConstant.BIT, isNull = false, comment = "是否置顶", defaultValue = "true")
    private Boolean isTop;

    @TableField("is_push")
    @Column(name = "is_push", type = MySqlTypeConstant.BIT, isNull = false, comment = "是否推送", defaultValue = "false")
    private Boolean isPush;

    @TableField("deleted")
    @Column(name = "deleted", type = MySqlTypeConstant.TINYINT, length = 1, isNull = false, comment = "是否删除 1表示删除 0表示未删除", defaultValue = "0")
    private Short deleted;

    @Column(name = "create_time", type = MySqlTypeConstant.DATETIME, isNull = false, comment = "创建时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Column(name = "update_time", type = MySqlTypeConstant.DATETIME, isNull = false, comment = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
